package com.yang.designmode.singleton.business;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer;

/**
 * 日志类
 */
public class Logger1 {
    //实现日志的输出
    private FileWriter fileWriter;

    //实现日志输出
    public Logger1() {
        File file = new File("./log.txt");
        try {
            FileWriter writer = new FileWriter(file, true);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }

    /**
     * 对外输出日志的方法
     * @param message
     */
    public void log(String message) throws IOException {
        fileWriter.write(message);
    }
}
